<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>123</p>
    <button onclick="submit()">点我</button>
</body>
<script>
    let obj = {
        name:'张三'
    }
    let goods = new Proxy(obj,{
        get(obj,index,value){
            return obj[index]
        },
        set(obj,index,newvalue){
            obj[index]=newvalue
            return true
        }
    })
    const submit = () =>{
        let b = "456"
        document.documentElement.querySelector('p').innerHTML = b
    }
</script>
</html>